<template>
	<view class="operateDaily">
		<uni-nav-bar color="#ffffff" background-color="#00aded" :statusBar="true" title="运行日报" fixed="true"></uni-nav-bar>
		<view class="top">
			<uni-datetime-picker type="date" :clear-icon="false" v-model="single" />
			<dil-search :columnData="options.columnDataList" @onSearch="onSearch" v-if="options.columnDataList.length > 0"></dil-search>
		</view>
		<view class="main">
			<view class="purchaseAppoint_main">
				<dil-card class="dilCard" @emitEvent="emitEvent" v-bind.sync="options"></dil-card>
			</view>
		</view>
		<view class="floot"></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			single: new Date(),
			options: {
				requestUrl: '/api/v1/report/getOperateDaily?apiId=717',
				requestQuery: {},
				cardSlotList: [],
				columnDataList: [],
				totalNum: 0
			}
		};
	},
	watch: {
		single(val) {
			this.onSearch();
		}
	},
	created() {
		this.fixedParams = {
			driverPhone: uni.getStorageSync('userName')
		};
	},
	onShow() {
		this.onSearch();
	},
	methods: {
		onSearch(item = {}) {
			this.options.requestQuery = {
				...JSON.parse(JSON.stringify(item)),
				...{
					driverPhone: uni.getStorageSync('userName'),
					dailyDate: this.single
				}
			};
		}
	}
};
</script>

<style lang="scss">
.operateDaily {
	.top {
		margin-top: 10rpx;
		margin-bottom: 10rpx;
	}
}
</style>
